import { configureStore } from '@reduxjs/toolkit'



// 在此处导入子仓库
import exampleReducer from './example'
import colectReducer from './colect'
export const store = configureStore({
    
    reducer: {
        // 在此处将子仓库合并到总仓库
        example: exampleReducer,
        colect: colectReducer
    }
})



// 从 store 本身推断出 `RootState` 和 `AppDispatch` 类型
export type RootState = ReturnType<typeof store.getState>
// 推断出类型: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch